<?php
 header("Content-type: text/html; charset=utf-8"); 
include('connect.php');
$userlat = $_GET['userlat'];
$userlog = $_GET['userlog'];
$useropenid = $_GET['useropenid'];
$addtime = $_GET['addtime'];
$times = $_GET['times'];
$type = $_GET['type'];
$useropenid = $_GET['useropenid'];
$rand = $_GET['rand'];
// 创建连接
if($type=='read'){
	//向数据库中插入数据
	$sql = "UPDATE send_log set tfread='true' where touser='".$useropenid."' and rand=".$rand;
	// echo $sql;
	if ($db->query($sql) === TRUE) {
	    echo "succeed,用户阅读反馈更新";
	} else {
	    echo "Error creating database: " . $db->error;
	    
	}
}else{
	//向数据库中插入数据
	$sql = "UPDATE list set userlat='".$userlat."',userlog='".$userlog."',addtime='".$addtime."',times='".$times."' where useropenid='".$useropenid."'";
	// echo $sql;
	if ($db->query($sql) === TRUE) {
	    echo "succeed,更新用户位置成功";
	} else {
	    echo "Error creating database: " . $db->error;
	    
	}
}


?>